package web.Employee;

import services.CourtsServiceAll;
import services.EmployeeService;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.math.BigDecimal;

@WebServlet("/updateEmployeesWages")
public class UpdateEmployeesWages extends HttpServlet {
    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        resp.setContentType("application/json");
        BigDecimal employeesWages = new BigDecimal(req.getParameter("employeesWages"));
        int employee_id = Integer.parseInt(req.getParameter("employee_id"));
        int num = new EmployeeService().updateEmployeesWages(employeesWages,employee_id);
        resp.getWriter().println(num > 0?"修改成功":"修改失败");
    }
}
